'''
Created on 2009-11-15

@author: Administrator
'''
from google.appengine.ext import db
from mod.tpl import Tpl

class Avatar(Tpl):
    '''
    classdocs
    '''
    def get(self):
        
        imgid = self.request.get('imgid')
        
        member = db.get(imgid)
        if member.avatar:
            self.response.headers['Content-Type'] = "image/png"
            self.response.out.write(member.avatar)
        else:
            self.redirect("/images/avatar.jpg")
            
        